package com.jvxb.common.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author jvxb
 * @since 2021-01-07
 */
public class DictUtil {

    public static final String IDC_FLAG = "idc_flag";
    public static final String DEPLOY_STATUS_FLAG = "deploy_status_flag";

    public static Map<String, String> getDictMap(String dictName) {
        if(dictName.equalsIgnoreCase(IDC_FLAG)) {
            return getIdcFlag();
        }
        if(dictName.equalsIgnoreCase(DEPLOY_STATUS_FLAG)) {
            return getDeployStatusFlag();
        }
        return new HashMap<>();
    }

    //0未部署 1部署中 2部署成功 3部署失败
    private static Map<String, String> getDeployStatusFlag() {
        Map dictMap = new HashMap();
        dictMap.put("0", "未部署");
        dictMap.put("1", "部署中");
        dictMap.put("2", "部署成功");
        dictMap.put("3", "部署失败");
        return dictMap;
    }

    private static Map<String,String> getIdcFlag() {
        Map dictMap = new HashMap();
        dictMap.put("sz", "深圳");
        dictMap.put("hz", "杭州");
        return dictMap;
    }

}
